import os

Import('env')
Import('id_dict')

env = env.Clone()

all_srcs = ['wifi_api.c', 'wifi_mesh_api.c', 'wifi_softap_api.c',]

objs = []
for src in all_srcs:
    base_name = os.path.basename(src)
    if base_name in id_dict:
        c_env = env.Clone()
        c_env.Append(CPPDEFINES = [('__NEW_FILE_ID__', id_dict[base_name])])
        objs.append(c_env.Object(src))
    else:
        objs.append(env.Object(src))
objs.sort()

Return('objs')
